import Vue from 'vue'
import Router from 'vue-router'

import Index from '@/pages/index'
import ProductsAndServers from '@/pages/productsAndServers/productsAndServers'
import Pa1 from '@/pages/productsAndServers/pa1'
import Pa2 from '@/pages/productsAndServers/pa2'
import MarketActivity from '@/pages/marketActivity/marketActivity'
import Resources from '@/pages/resources/resources'
import AboutUs from '@/pages/aboutUs/aboutUs'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      name: 'index',
      component: Index
    },
    {
      path: '/productsAndServers',
      name: 'productsAndServers',
      component: ProductsAndServers
    },
    {
      path: '/marketActivity',
      redirect: '/marketActivity/pa1/1',
      name: 'marketActivity',
      component: MarketActivity,
      children: [
        {
          path: 'pa1/:id',
          name: 'pa1',
          component: Pa1
        },
        {
          path: 'pa2/:id',
          name: 'pa2',
          component: Pa2
        }
      ]
    },
    {
      path: '/resources',
      name: 'resources',
      component: Resources
    },
    {
      path: '/aboutUs',
      name: 'aboutUs',
      component: AboutUs
    }
  ]
})
